import { axios } from "../../utils/request";

const api = {
    list: "/member/goods/page",
    save: "/member/goods/save",
    disable: "/member/goods/disable",
    enable: "/member/goods/enable",
    delete: "/member/goods/delete",

    useUrl: '/member/goods/useGoods',//使用商品
    sortUrl: '/member/goods/updateGoodsSort',//保存排序
    getByGoodsId: '/crm/goodsCallSetting/getByGoodsId',//获取话费商品详情
    pageGoodsSetting:'/member/goods/pageGoodsSetting',//获取话费商品详情



};

/**
 * 列表
 */
export function pageList (parameter) {
    return axios({
        url: api.list,
        method: "get",
        params: parameter
    });
}

/**
 * 保存
 */
export function save (parameter) {
    return axios({
        url: api.save,
        method: "post",
        data: parameter
    });
}

/**
 * 停用
 */
export function disable (parameter) {
    return axios({
        url: api.disable,
        method: "post",
        data: parameter
    });
}

/**
 * 启用
 */
export function enable (parameter) {
    return axios({
        url: api.enable,
        method: "post",
        data: parameter
    });
}

/**
 * 使用商品
 */
export function useGoods (parameter) {
    return axios({
        url: api.useUrl,
        method: "get",
        params: parameter
    });
}

/**
 * 删除
 */
export function deleteConsignee (parameter) {
    return axios({
        url: api.delete,
        method: "get",
        params: parameter
    });
}
/**
 * 保存排序
 */
export function sortFun (parameter) {
    return axios({
        url: api.sortUrl,
        method: "post",
        data: parameter
    });
}
/**
 * 获取话费商品详情
 */
export function getByGoodsId (parameter) {
    return axios({
        url: api.getByGoodsId,
        method: "get",
        params: parameter
    });
}


/**
 * 获取话费商品详情
 */
 export function pageGoodsSetting (data) {
    return axios({
        url: api.pageGoodsSetting,
        method: "post",
        data: data
    });
}